<style lang="scss">
@import './index.scss';
</style>

<template>
    <div class="withdrawalBox">
        <van-nav-bar title="H币提现" right-text="提现记录" left-arrow @click-left="onClickLeft" @click-right="onClickRight" />
        <div class="withdrawal-box">
            <div class="withdrawalTop">
                <van-nav-bar title="中国建设银行" left-text="到账银行卡" />
            </div>
            <div class="withdrawalCon">
                <h4>提现金额</h4>
                <p>￥<input type="text" v-model="moneyB"></p>
            </div>
            <div class="withdrawalFoot">
                <p>
                    <van-checkbox shape="square" v-model="checked" icon-size="14px">
                        <h6>全部提现。3050H币,可提现30元</h6>
                    </van-checkbox>
                </p>
                <van-button style="margin-top: 30px;" type="primary" block @click="tx">提现</van-button>
            </div>
        </div>
    </div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { useRouter } from 'vue-router'

const checked = ref(false)
// 使浏览器回到上一个访问的页面，实现类似于 “返回” 的功能
const onClickLeft = () => history.back();
const router = useRouter()
const onClickRight = () => router.push('/record')
const moneyB:any = ref(0)

const tx = () => {
    if (moneyB.value <= 0) {
        return
    } else {
        localStorage.setItem('moneyB', moneyB.value)
        // localStorage.setItem('moneyA', JSON.stringify(moneyA.value))
        router.push('/progress')
    }
}
</script>
